<template>
  <footer class="footer">
    <div class="container">
      <div class="footer-content">
        <!-- 主要信息区域 -->
        <div class="footer-main">
          <div class="footer-section">
            <h3>关于我们</h3>
            <p>Web商城致力于为用户提供优质的购物体验，我们提供丰富的商品种类和便捷的购物服务。</p>
            <div class="social-links">
              <a href="#" class="social-link">
                <WechatOutlined />
              </a>
              <a href="#" class="social-link">
                <WeiboOutlined />
              </a>
              <a href="#" class="social-link">
                <QqOutlined />
              </a>
            </div>
          </div>
          
          <div class="footer-section">
            <h3>快速链接</h3>
            <ul class="footer-links">
              <li><a @click="goToPage('/products')">全部商品</a></li>
              <li><a @click="goToPage('/category/手机数码')">手机数码</a></li>
              <li><a @click="goToPage('/category/电脑办公')">电脑办公</a></li>
              <li><a @click="goToPage('/category/家用电器')">家用电器</a></li>
              <li><a @click="goToPage('/about')">关于我们</a></li>
            </ul>
          </div>
          
          <div class="footer-section">
            <h3>客户服务</h3>
            <ul class="footer-links">
              <li><a @click="goToPage('/help')">帮助中心</a></li>
              <li><a @click="goToPage('/contact')">联系我们</a></li>
              <li><a @click="goToPage('/shipping')">配送说明</a></li>
              <li><a @click="goToPage('/return')">退换货政策</a></li>
              <li><a @click="goToPage('/privacy')">隐私政策</a></li>
            </ul>
          </div>
          
          <div class="footer-section">
            <h3>联系我们</h3>
            <div class="contact-info">
              <p><PhoneOutlined /> 客服热线：400-123-4567</p>
              <p><MailOutlined /> 邮箱：service@webmall.com</p>
              <p><EnvironmentOutlined /> 地址：北京市朝阳区xxx街道xxx号</p>
              <p><ClockCircleOutlined /> 工作时间：9:00-18:00</p>
            </div>
          </div>
        </div>
        
        <!-- 底部版权信息 -->
        <div class="footer-bottom">
          <div class="copyright">
            <p>&copy; 2024 Web商城. 保留所有权利.</p>
          </div>
          <div class="footer-extra">
            <a @click="goToPage('/terms')">服务条款</a>
            <a @click="goToPage('/privacy')">隐私政策</a>
            <a @click="goToPage('/sitemap')">网站地图</a>
          </div>
        </div>
      </div>
    </div>
  </footer>
</template>

<script setup>
import { useRouter } from 'vue-router'
import {
  WechatOutlined,
  WeiboOutlined,
  QqOutlined,
  PhoneOutlined,
  MailOutlined,
  EnvironmentOutlined,
  ClockCircleOutlined
} from '@ant-design/icons-vue'

const router = useRouter()

const goToPage = (path) => {
  router.push(path)
}
</script>

<style scoped>
.footer {
  background-color: #2c3e50;
  color: white;
  padding: 40px 0 20px;
  margin-top: auto;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.footer-main {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.footer-section h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 15px;
  color: #ecf0f1;
}

.footer-section p {
  line-height: 1.6;
  color: #bdc3c7;
  margin-bottom: 15px;
}

.social-links {
  display: flex;
  gap: 15px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: #34495e;
  border-radius: 50%;
  color: white;
  font-size: 18px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.social-link:hover {
  background-color: #3498db;
  transform: translateY(-2px);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: #bdc3c7;
  text-decoration: none;
  transition: color 0.3s ease;
  cursor: pointer;
}

.footer-links a:hover {
  color: #3498db;
}

.contact-info p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #bdc3c7;
}

.contact-info .anticon {
  color: #3498db;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid #34495e;
}

.copyright p {
  color: #95a5a6;
  margin: 0;
}

.footer-extra {
  display: flex;
  gap: 20px;
}

.footer-extra a {
  color: #95a5a6;
  text-decoration: none;
  transition: color 0.3s ease;
  cursor: pointer;
}

.footer-extra a:hover {
  color: #3498db;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .footer {
    padding: 30px 0 15px;
  }
  
  .footer-main {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .footer-extra {
    justify-content: center;
  }
  
  .social-links {
    justify-content: center;
  }
}
</style> 